package com.zzy.mccjt.controller.sys;

import com.zzy.mccjt.entity.SysUser;
import com.zzy.mccjt.service.sys.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @program: mccjt-cloud
 * @description: 系统用户
 * @author: zhouyang.zheng
 * @create: 2022-08-10 17:16
 **/
@Api(value = "系统用户", tags = "系统用户")
@RestController
@RequestMapping("/api/v1/sys_user")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SysUserController {

    private final SysUserService sysUserService;

    @ApiOperation("根据id获取用户信息")
    @GetMapping("/{id}")
    public SysUser getById(@PathVariable("id") Long id) {
        return sysUserService.getById(id);
    }

    @ApiOperation("根据id获取用户信息")
    @PutMapping()
    public SysUser save(SysUser sysUser) {
        return sysUserService.save(sysUser);
    }


}
